local skel = fk.CreateSkill{
  name = "kt_st__wuji",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["kt_st__wuji"] = "武极",
  [":kt_st__wuji"] = "锁定技，出牌阶段开始时，你将随机杀死三名角色；若不包含你，则改为你各对其造成1点伤害。",

  ["$kt_st__wuji1"] = "一拳作两步，两步杀三人！",
  ["$kt_st__wuji2"] = "宇文成都固然勇猛，敌我，不过螳臂当车！",
}

skel:addEffect(fk.EventPhaseStart, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player.phase == player.Play and #player.room.alive_players > 2
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    --选人
    local tps = table.random(room.alive_players, 3)--随机选三个人
    room:sortByAction(tps)--保证符合逆时针结算顺序
    if tps[1] == player then--如果有玩家，将玩家调到三号
      table.remove(tps,1)
      table.insert(tps,player)
    end
    --结算
    for _, p in ipairs(tps) do
      if player.dead then break end
      if not p.dead then
        if tps[3] == player then
          room:killPlayer{--杀人
            who = p,
            killer = player,
          }
        else
          room:damage{--伤害
            from = player,
            to = p,
            damage = 1,
            skillName = skel.name,
          }
        end
      end
    end
  end,
})

return skel